﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Pedido.aspx.cs" Inherits="PedidoWeb.Pedido" MasterPageFile="~/Site.Master" %>

<asp:content id="HeadContent" ContentPlaceHolderID="HeadContent" runat="server">
    <title>Pedidos</title>
    
    <script src="/Scripts/jquery.maskedinput-1.3.min.js" type="text/javascript"></script>
    
    <script type="text/javascript">
        jQuery(document).ready(function ($) {
            addingNumericalMask($('#MainContent_txtQuantidade'));
            addingDateMask($('#MainContent_txtData'));
        });
    </script> 
    <style type="text/css">
        .style4
        {
            height: 23px;
            font-weight: bold;
            width: 82px;
        }
        .style5
        {
            height: 23px;
            font-weight: bold;
            width: 61px;
        }
        .style7
        {
            font-family: Tahoma;
            font-size: small;
            width: 29px;
        }
    </style>
</asp:content>


<asp:Content ID="conteudo" ContentPlaceHolderID="MainContent" runat="server">
    <div>
    
        <asp:Label ID="Label8" runat="server" Font-Bold="True" 
            Text="Cadastro de Pedido"></asp:Label>
    
        <br />
    
        <br />
        <asp:Label ID="lblMensagem" runat="server"></asp:Label>
        <br />
    
    </div>
    <table style="width: 100%; height: 80px;">
        <tr>
            <td class="style7">
                <asp:Label ID="lblCodigo" runat="server" Text="Código: " Visible="False"></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="txtCodigo" runat="server" Visible="False" 
                    style="text-align: left"></asp:TextBox>
            </td>
            <td class="style4">
                <asp:DropDownList ID="cmbAcao" runat="server" AutoPostBack="True" Height="23px" 
                    onselectedindexchanged="cmbAcao_SelectedIndexChanged">
                    <asp:ListItem Value="0">Cadastrar</asp:ListItem>
                    <asp:ListItem Value="1">Consultar</asp:ListItem>
                    <asp:ListItem Value="2">Excluir</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                <asp:Label ID="lblDescricao" runat="server" Text="Descrição: "></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="txtDescricao" runat="server" style="text-align: left"></asp:TextBox>
            </td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                <asp:Label ID="lblData" runat="server" Text="Data:"></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="txtData" runat="server" style="text-align: left"></asp:TextBox>
            </td>
            <td class="style4">
                <asp:Label ID="lblResultado" runat="server" Text="Resultado:" Visible="False"></asp:Label>
            </td>
            <td class="style5">
                <asp:Label ID="lblValorTotal" runat="server" Visible="False"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style7">
                <asp:Label ID="lblValorDesconto" runat="server" Text="Valor Desconto:"></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="txtDesconto" runat="server" style="text-align: left"></asp:TextBox>
            </td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                <asp:Label ID="lblCliente" runat="server" Text="Cliente:"></asp:Label>
            </td>
            <td class="style1">
                <asp:DropDownList ID="cmbCliente" runat="server" Height="23px" Width="185px" 
                    style="text-align: left">
                </asp:DropDownList>
            </td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                <asp:Label ID="lblOrcamento" runat="server" Text="Orçamento:"></asp:Label>
            </td>
            <td class="style1">
                <asp:TextBox ID="txtOrcamento" runat="server" style="text-align: left"></asp:TextBox>
            </td>
            <td class="style4">
                <asp:Label ID="Label7" runat="server" Text="Qtde:"></asp:Label>
            </td>
            <td class="style5">
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style7">
                <asp:Label ID="lblProduto" runat="server" Text="Produto:"></asp:Label>
            </td>
            <td class="style1">
                <asp:DropDownList ID="cmbProduto" runat="server" Height="23px" Width="186px" 
                    style="text-align: left; margin-left: 0px">
                </asp:DropDownList>
            </td>
            <td class="style4">
                <asp:TextBox ID="txtQuantidade" runat="server" Width="73px"></asp:TextBox>
            </td>
            <td class="style5">
                <asp:Button ID="btnAdicionar" runat="server" Text="+" Width="35px" 
                    onclick="btnAdicionar_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:GridView ID="dtgProdutos" runat="server" style="margin-right: 0px" 
                    Width="632px" AutoGenerateColumns="False" BackColor="#CCCCCC" 
                    BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" 
                    CellSpacing="2" ForeColor="Black">
                    <Columns>
                        <asp:BoundField DataField="codigoProduto" HeaderText="Código" ReadOnly="True" />
                        <asp:BoundField DataField="nomeProduto" HeaderText="Nome" ReadOnly="True" />
                        <asp:BoundField DataField="quantidade" HeaderText="Quantidade" 
                            ReadOnly="True" />
                    </Columns>
                    <FooterStyle BackColor="#CCCCCC" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                    <RowStyle BackColor="White" />
                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>
            </td>
            <td class="style4">
                &nbsp;</td>
            <td class="style5">
                <asp:Button ID="btnCadastrar" runat="server" Text="Cadastrar" 
                    onclick="btnCadastrar_Click" />
            </td>
        </tr>
    </table>
</asp:Content>